package com.wsx.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * Day1
 *      根据employee表创建实体类映射
 *          1.实体类为什么实现序列化接口--private static final long serialVersionUID = 1L;
 *          2.开启驼峰命名
 *          3.时间类型LocalDateTime
 *          4.@TableField(fill = FieldFill.INSERT)、@TableField(fill = FieldFill.INSERT_UPDATE)
 */
@Data
public class Employee implements Serializable {
    private static final long serialVersionUID = 1L;

    private Long id;

    private String username;

    private String name;

    private String password;

    private String phone;

    private String sex;

    private String idNumber; //驼峰命名法 ---> 映射的字段名为 id_number

    private Integer status;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;       //FieldFill.INSERT: 插入时填充该属性值

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;       //FieldFill.INSERT_UPDATE: 插入/更新时填充该属性值

    @TableField(fill = FieldFill.INSERT)
    private Long createUser;                //FieldFill.INSERT: 插入时填充该属性值

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;                //FieldFill.INSERT_UPDATE: 插入/更新时填充该属性值
}
